package com.xoa.dao.equipment;
import com.xoa.model.equipment.EquipType;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
@Repository
public interface EquipTypeMapper {

    /*查找最大排序号*/
    Integer MaxSort(Integer equipTypePid);
    /*修改排序号*/
    int changeSort(EquipType equipType);
    /*跟据pid查询当前父类下的所有typeId和sort*/
    List<EquipType> selAllSortByPid(Integer equipTypePid);

    int editSortById(EquipType equipType);

    List<EquipType> selList(Integer equipTypePid);
    List<EquipType> selectAllEquipType();

    List<EquipType>selectNameAndId();

    List<EquipType> selectParentEquipType();

    int contChild(Integer id);

    List<EquipType> selectChildEquipType(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    int insert(EquipType record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    int insertSelective(EquipType record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    EquipType selectByPrimaryKey(Integer id);

    List<EquipType> selectBySort(Integer equipSort);

    int maxEquipTypeSort();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(EquipType record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lims_equip_types
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(EquipType record);
    //这个方法查询得是某个目标以后得所有设备类型
    List<EquipType> selectSortEquipType(Integer start, Integer end);//这个id是移动至某个目标下的类型id

    //根据pids得到记录集合
    List<EquipType> selectEquipTypeByIds(List<Integer> pids);

    //查询所有传感器
    List<EquipType> selectAllSensor(String lable);

    /** 根据equipTypeCode查询类型信息 **/
    EquipType selectTypename(Map map);

    int  updateCode(Map map);
    List <EquipType> findItemEquipType(Map map);
    List<EquipType> selctByTypeCode(Map map);

    //查询设备类型
    EquipType selectByLable(String lable);

    EquipType selectByLablenew(Integer id);

    EquipType selectByPid(Integer pid);

    //wss根据设备Id查找父级信息
    EquipType selectBychildrenPid(Integer equipTypeId);

    List<Integer> selectTypeNode(Integer typeId);
}